#include <stdio.h>
#include <stdlib.h>

int main (int argc, char const* argv[])
{
    int n, i, j, t, a[100], cnt;

    scanf("%d", &n);
    for (i = 0; i < n; i++) {
        scanf("%d", &a[i]);
    }

    // sort
    for (i = 0; i < n-1; i++) {
        for (j = i+1; j < n; j++) {
            if (a[i] > a[j]) {
                t = a[i];
                a[i] = a[j];
                a[j] = t;
            }
        }
    }

    // uniq
    cnt = 1;
    for (i = 1; i < n; i++) {
        if (a[i] != a[i-1]) cnt++;
    }

    printf("%d\n", cnt);
    printf("%d ", a[0]);
    for (i = 1; i < n; i++) {
        if (a[i] != a[i-1]) {
            printf("%d ", a[i]);
        }
    }
    printf("\n");

    return 0;
}
